'''
Company: TWL
Author: xue jian
Email: xuejian@kanzhun.com
Date: 2020-10-26 09:33:11
'''
#
# @lc app=leetcode.cn id=1365 lang=python3
#
# [1365] 有多少小于当前数字的数字
#

# @lc code=start
class Solution:
    def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
        sort_num = sorted(nums)
        map_num={}
        for i, v in enumerate(sort_num):
            if v in map_num:
                continue
            map_num[v] = i
        re = [map_num[i] for i in nums ]
        return re
# @lc code=end

